package org.jash.learnmvp.user;

import org.jash.learnmvp.entity.CodeEntity;
import org.jash.learnmvp.entity.LoginEntity;
import org.jash.learnmvp.entity.Res;

import io.reactivex.rxjava3.core.Observable;

public class ConStruct {
    public interface ILoginModel {
        Observable<LoginEntity> login(String username, String password);
    }
    public interface ILoginPresenter {
        void login(String username, String password);
    }
    public interface ILoginView {
        void loginSuccess(String token);
        void loginFailure(Throwable throwable);
    }
    public interface ICodeLoginModel {
        Observable<CodeEntity> getLCode(String phone);
        Observable<LoginEntity> login(String phone, String code);
        Observable<LoginEntity> logout();

    }
    public interface ICodeLoginPresenter {
        void loadCode(String phone);
        void login(String phone, String code);
        void logout();
    }
    public interface ICodeLoginView {
        void codeSuccess(int code);
        void loginSuccess(String token);
        void logoutSuccess();
        void failure(Throwable throwable);
    }
    public interface IRegisterModel {
        Observable<CodeEntity> getRCode(String phone);
        Observable<Res> register(String username, String password, String phone);
        Observable<Res> verify(String phone, String code);
    }
    public interface IRegisterPresenter {
        void loadCode(String phone);
        void register(String username, String password, String phone);
        void verify(String phone, String code);
    }
    public interface IRegisterView {
        void codeSuccess(int code);
        void registerSuccess(String msg);
        void verifySuccess(String msg);
        void failure(Throwable throwable);
    }
}
